package com.yuan.yblog.common.api;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 枚举类 : API返回码
 *
 */
@Getter
@AllArgsConstructor
public enum ResultCode {

    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    VALIDATE_FAILED(404, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录/登录已经过期"),
    FORBIDDEN(403, "没有相关权限"),
    REJECT(403, "请求太频繁了，休息一下吧~")
    ;

    /**
     * 响应状态码
     */
    private final long code;

    /**
     * 响应信息
     */
    private final String message;
}
